package ControlLayer;
import ModelLayer.ProductAttribute;
import DBLayer.DBProductAttribute;
import java.util.ArrayList;

public class CtrProductAttribute {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrProductAttribute instance = null;
    DBProductAttribute dbProductAttribute = new DBProductAttribute();

    public CtrProductAttribute() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrProductAttribute getInstance() {
        if (instance == null) {
            instance = new CtrProductAttribute();
        }
        return instance;
    }

    public ArrayList<ProductAttribute> getProductAttributeList() {
        return dbProductAttribute.getProductAttributeList();
    }

    public ProductAttribute getProductAttributeByID(int id) {
        return dbProductAttribute.getProductAttributeByID(id);
    }

    public int addProductAttribute(ProductAttribute productAttribute) {
        return dbProductAttribute.addProductAttribute(productAttribute);
    }

    public int updateProductAttribute(ProductAttribute productAttribute, int id) {
        return dbProductAttribute.updateProductAttribute(productAttribute, id);
    }

    public void deleteProductAttribute(int id) {
        dbProductAttribute.deleteProductAttribute(id);
    }
    // </editor-fold>
}
